<!DOCTYPE html>
<html>
<head>
    <title>费用报销</title>
    #parse("sys/header.html")
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList">
        <div class="grid-btn">
            <a class="btn btn-primary" @click="query">&nbsp;查询</a>
            #if($shiro.hasPermission("fybx:save"))
            <a class="btn btn-primary" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</a>
            #end
            #if($shiro.hasPermission("fybx:update"))
            <a class="btn btn-primary" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</a>
            #end
            #if($shiro.hasPermission("fybx:delete"))
            <a class="btn btn-primary" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
            #end
            #if($shiro.hasPermission("fybx:list"))
            <a class="btn btn-primary" @click="querydet">&nbsp;查看明细</a>
            <a class="btn btn-primary" @click="queryfile">&nbsp;查看附件</a>
            #end
            #if($shiro.hasPermission("fybx:submit"))
            <a class="btn btn-primary" @click="submit"><i class="fa fa-pencil-square-o"></i>&nbsp;提交</a>
            #end
            #if($shiro.hasPermission("fybx:processInt"))
            <a class="btn btn-primary" @click="processInt"><i class="fa fa-pencil-square-o"></i>&nbsp;审批</a>
            #end
            #if($shiro.hasPermission("fybx:popHistory"))
            <a class="btn btn-primary" @click="popHistory"><i class="fa fa-pencil-square-o"></i>&nbsp;审批历史记录</a>
            #end
        </div>
        <table id="jqGrid"></table>
        <div id="jqGridPager"></div>
    </div>


    <div v-show="!showList&&!showtable" class="panel panel-default">
        <div class="panel-heading">{{title}}</div>
        <form class="form-horizontal">
            <div class="form-group">
                <div class="col-sm-1 control-label">报销部门</div>
                <div class="col-sm-2">
                    <input type="text" class="form-control" v-model="fybx.bxbm" placeholder="请选择" readonly="readonly" @click="selectunit" />
                </div>
                <div hidden="true">
                    <div class="col-sm-1 control-label">报销部门id</div>
                    <div class="col-sm-2">
                        <input type="text" class="form-control" v-model="fybx.bxbmid" placeholder="报销部门id"/>
                    </div>
                </div>
                <div class="col-sm-1 control-label">原借款</div>
                <div class="col-sm-2">
                    <input type="text" class="form-control" v-model="fybx.yjk" placeholder="原借款"/>
                </div>
                <div class="col-sm-1 control-label">应退(补)款</div>
                <div class="col-sm-2">
                    <input type="text" class="form-control" v-model="fybx.ytbk" placeholder="应退(补)款"/>
                </div>
            </div>

            <div class="form-group">
                <div class="col-sm-1 control-label">合计金额</div>
                <div class="col-sm-2">
                    <input type="text" class="form-control" v-model="fybx.hjje" placeholder="合计金额"  readonly="readonly"/>
                </div>
                <div class="col-sm-1 control-label">结算点</div>
                <div class="col-sm-2">
                    <select v-model="fybx.settlementpoint" class="form-control">
                        <option v-for="setlever in setlever" :value="setlever.value">{{setlever.label}}</option>
                    </select>
                </div>
                <div class="col-sm-1 control-label">备注</div>
                <div class="col-sm-2">
                    <input type="text" class="form-control" v-model="fybx.bz" placeholder="备注"/>
                </div>
            </div>

            <div class="form-group">
                <div class="panel panel-default">
                    <div class="panel-heading">报销明细</div>

                    <input type="button" class="btn btn-primary" @click="addCertificateItem" value="增加">
                    <template v-for="(fybxDet, index) in fybxDetList ">
                        <hr style="height:1px;border:none;border-top:1px solid #555555;" />
                        <div class="form-group">
                            <div class="col-sm-1 control-label">报销项目</div>
                            <div class="col-sm-2">
                                <input type="text" class="form-control" v-model="fybxDet.bxXm" placeholder="报销项目"/>
                            </div>
                            <div class="col-sm-1 control-label">实际费用项目</div>
                            <div class="col-sm-2">
                                <input type="text" class="form-control" v-model="fybxDet.sjfyXm" placeholder="实际费用项目"/>
                            </div>
                            <div class="col-sm-1 control-label">摘要</div>
                            <div class="col-sm-2">
                                <input type="text" class="form-control" v-model="fybxDet.zy" placeholder="摘要"/>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-1 control-label">报销金额</div>
                            <div class="col-sm-2">
                                <input type="text" class="form-control" v-model="fybxDet.bxJe" placeholder="报销金额"/>
                            </div>
                            <div class="col-sm-1 control-label">备注</div>
                            <div class="col-sm-6">
                                <input type="text" class="form-control" v-model="fybxDet.bz" placeholder="备注"/>
                            </div>
                            <input type="button" class="btn btn-del" @click="delCertificateItem(index)" value="删除">
                        </div>

                    </template>
                </div>
            </div>



            <div class="form-group">
                <div class="col-sm-2 control-label"></div>
                <input type="button" class="btn btn-primary" @click="saveOrUpdate" value="确定"/>
                &nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="reload" value="返回"/>
            </div>
        </form>
    </div>

    <div v-show="showtable" class="panel panel-default">
        <div class="panel-heading">{{title}}</div>
        <form class="form-horizontal">
            <div class="form-group"  >
                <div class="col-sm-2 control-label">审批意见</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="fybx.remark" placeholder="审批意见"/>
                </div>
            </div>

            <div class="form-group">
                <div class="col-sm-2 control-label"></div>
                <input type="button" class="btn btn-primary" @click="process" value="批准"/>
                <input type="button" class="btn btn-primary" @click="reject" value="拒绝"/>
                <input type="button" class="btn btn-primary" @click="reload" value="返回"/>
            </div>
        </form>
    </div>

</div>

<!-- 弹出历史记录 -->
<div id="popHistory" style="display: none;padding:10px;">
    <table id="popHistoryGrid"></table>
    <div id="popHistoryGridPager"></div>
</div>
<!--报销明细弹窗开始-->
<div id="window" hidden="true">
    <table id="jqGridTable"></table>
</div>
<!--报销明细弹窗结束-->
<!--部门树弹窗开始-->
<div id="windowtree" hidden="true">
<ul id="menuTree" class="ztree">
</ul>
</div>
<!--部门树弹窗结束-->
<script src="${rc.contextPath}/js/workflow/fybx.js?_${date.systemTime}"></script>
</body>
</html>